#include <stdio.h>

int a(const char * str, char c)
{
    int count = 0;

    // 遍历字符串
    for (int i = 0; str[i] != '\0'; i++) {
        if (str[i] == ',') {
            count++;
        }
    }
    return count;
}
int main() {
    char str[] = "1:2,3:4,5:6";
    printf("%d\n", a(str, 'c'));

    return 0;
}